/**
 * Copyright (C), 2015-2020, XXX有限公司
 * FileName: PermissionService
 * Author:   sky
 * Date:     2020/5/19 9:13
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package cn.szh.service;

import cn.szh.dao.PermissionDao;
import cn.szh.domain.Permission;
import cn.szh.face.IPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 〈一句话功能简述〉<br> 
 * 〈〉
 *
 * @author sky
 * @create 2020/5/19
 * @since 1.0.0
 */
@Service
public class PermissionService implements IPermissionService {
    @Autowired
    private PermissionDao permissionDao;
    public List<Permission> findAll() {
        List<Permission> permissions = permissionDao.findAll();
        return permissions;
    }

    public void save(String permissionName, String url) {
        permissionDao.save(permissionName,url);
    }

    public Permission findById(Integer id) {
        Permission permission = permissionDao.findByPid(id);
        return permission;
    }

    public void delete(Integer id) {
        permissionDao.delete(id);
    }
}
